import {Component} from "react";
import Taro from "@tarojs/taro";
import {View} from "@tarojs/components";
import './item.scss'

class Item extends Component {
  formSubmit = e => {
    console.log(e)
    Taro.navigateTo({
      url: '/pages/classManage/index?id=1',
      events: {
        // 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
        acceptDataFromOpenedPage: function () {
          //console.log(data)
        },
        someEvent: function () {
          //console.log(data)
        }
      },
      success: function (res) {
        // 通过eventChannel向被打开页面传送数据
        res.eventChannel.emit('acceptDataFromOpenerPage', {data: 'test'})
      }
    }).then(() => {})
  }
  render() {
    return (
      <View onClick={this.formSubmit} className='classListitembox'>
        <View className='box1'>
          <View className='sub'>
            <View className='title'>启蒙二班</View>
            <View className='mask'>2级</View>
          </View>
          <View className='time'>16:20</View>
        </View>
        <View className='box2'>
          城市大城市DVD发v地方vv发
        </View>
      </View>
    )
  }
}
export default Item
